﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace weba.Sales
{
    public partial class AccountCurrentBalanceShow : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                //设置经办人
               Accounts_Users currentUser = mk.l.Accounts_Users.FirstOrDefault();
                //设置根部门ID
                var bllDept = mk.l.Accounts_Department.ToList();
                this.lblRootDepartmentID.Text = bllDept.Where(j => j.ClassID == (int.Parse(currentUser.DepartmentID))).FirstOrDefault().RootID.ToString();
                this.BindData();
            }
        }
        private void BindData()
        {
          //  UART.BLL.Sales.Account bll = new UART.BLL.Sales.Account();
           var ds = mk.l.Sales_Account.Where(y=>y.RootDepartmentID.ToString()==this.lblRootDepartmentID.Text).ToList();
            this.myGridView.DataSource = ds;
            this.myGridView.DataBind();
        }
    }
}